-
-
Notifications
You must be signed in to change notification settings - Fork 546
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add reimplement of "with apostrophes" test #1982
Conversation
As per [issue 1977](exercism#1977), if the user's code was unable to correctly handle words with multiple letters after an apostrophe (a plausible error one might make with a regex, for example), the previous version of the "with apostrophes" test, which only included the word "don't", would not detect the bug (and none of the other tests would find it either). This change is a reimplement of the "with apostrophes" test to now include the word "you're" as part of the input, so if the user's code has a bug and incorrectly handles such words, the new test will fail and expose it.
"laugh": 1, | ||
"then": 1, | ||
"cry": 1, | ||
"you're": 1, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I notice that the "don't" has a value of 2, while "you're" has a value of 1. Should it not be a 2 as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's only one instance of "you're" in the input text. Or do you mean we should use an input that includes "you're" multiple times?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope, sorry did not associate it directly with the inputs as a word count occurrence. Thought perhaps it was a contraction being counted as the two words it involves.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
As per issue 1977, if the user's code was unable to correctly handle words with multiple letters after an apostrophe, e.g. "they've" (a plausible error one might make with a regex, for example), the previous version of the "with apostrophes" test, which only included the word "don't", would not detect the bug (and none of the other tests would detect it, either).
This change is a reimplement of the "with apostrophes" test to now include the word "you're" as part of the input, so if the user's code has a bug and incorrectly handles such words, the new version of the test will fail appropriately, and expose it.